package com.project.base.common;

import java.io.IOException;
import java.util.Properties;

public class RhinoConstant {


    private static Properties properties;
    private static volatile RhinoConstant instance = null;

    private void init() {
        try {
            properties = new Properties();
            properties.load(getClass().getResourceAsStream("/const.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        // ResourceBundle.getBundle("const");
    }

    private RhinoConstant() {
        init();
    }

    public static RhinoConstant getInstance() {
        if (instance == null) {
            synchronized (RhinoConstant.class) {
                if (instance == null) {
                    instance = new RhinoConstant();
                    //instance.init();
                }
            }
        }
        return instance;
    }

    /**
     * 获取属性
     *
     * @return
     */
    public String getValue(String key) {
        return properties.getProperty(key);
    }


}
